Skip to content

[Repo Assist] test: add 23 unit tests for HtmlInference.inferListType and inferHeaders#1757

Merged
dsyme merged 2 commits intomainfrom
repo-assist/test-htmlinference-2026-04-23-d7c00d2a236baee0
Apr 23, 2026
Merged

[Repo Assist] test: add 23 unit tests for HtmlInference.inferListType and inferHeaders#1757
dsyme merged 2 commits intomainfrom
repo-assist/test-htmlinference-2026-04-23-d7c00d2a236baee0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Adds a new test file tests/FSharp.Data.Core.Tests/HtmlInference.fs with 23 unit tests covering the HtmlInference.inferListType and HtmlInference.inferHeaders internal functions, which had no dedicated test coverage.

What's covered

inferListType

  • Empty array → Null
  • Whitespace-only values ( , \t, "") → Null
  •   / &nbspNull (HTML non-breaking space treated as missing)
  • Integer values → int
  • Decimal values → decimal (e.g. "1.5")
  • Scientific-notation values → float (e.g. "1e100")
  • Boolean values → bool
  • String values → string
  • Mixing int + decimal → widens to decimal
  • Mixing int + scientific float → widens to float
  • Mixing numeric + non-numeric → Heterogeneous
  • NaN / NA with preferOptionals=falsefloat (explicit missing = float)
  • NaN with preferOptionals=trueNull
  • ISO date strings ("2023-01-01") → DateTime or DateOnly (runtime-dependent)
  • NaN + integers with preferOptionals=false → widens to float
  • Single integer → int

inferHeaders

  • Empty rows → (false, None, None, None)
  • Single row → (false, None, None, None)
  • Exactly two rows → (false, None, None, None) (not enough info)
  • Header row has different type than data rows → (true, Some headers, ...)
  • All rows have same type → (false, None, None, None)
  • When headers detected, data type is returned

Test Status

  • dotnet test tests/FSharp.Data.Core.Tests/ --filter "HtmlInference"23 passed, 0 failed
  • dotnet test tests/FSharp.Data.Core.Tests/2980 passed, 0 failed

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@96b9d4c39aa22359c0b38265927eadb31dcf4e2a

Cover key behaviours of the HTML table type-inference helpers:
- inferListType: empty/whitespace/  → Null; int, decimal, float
  (scientific), bool, string; NaN/NA as float (or Null with
  preferOptionals); DateOnly/DateTime for ISO date strings; mixing
  int+decimal widened to decimal; int+scientific widened to float;
  int+string produces Heterogeneous; NaN+int with preferOptionals=false
  widened to float
- inferHeaders: ≤2 rows → false; header-vs-data type mismatch → true
  with header names; uniform-type rows → false; data type returned

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dsyme dsyme marked this pull request as ready for review April 23, 2026 09:31
@dsyme dsyme merged commit 5fd7890 into main Apr 23, 2026
3 checks passed
@dsyme dsyme deleted the repo-assist/test-htmlinference-2026-04-23-d7c00d2a236baee0 branch April 23, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant